{extend name="base" /}
{block name="css"}
<link rel="stylesheet" type="text/css" href="__STATIC__/plugins/mmgrid/mmGrid.css?v={$v}" />
{/block}
{block name="js"}
<script src="__STATIC__/plugins/mmgrid/mmGrid.js?v={$v}" type="text/javascript"></script>
<script src="__ADMIN__/shops/shops.js?v={$v}" type="text/javascript"></script>
{/block}
{block name="main"}
<div class="layui-tab layui-tab-brief" lay-filter="msgTab">
    <ul class="layui-tab-title">
        <li class="layui-this">电脑端</li>
        <li>移动端</li>
    </ul>
    <div class="layui-tab-content" style="padding: 10px 0;">
      <div class="layui-tab-item layui-show">
          <div class="wst-toolbar" style='padding-top:0px;'>
          <select id="areaId1" class='j-ipt j-areas' level="0" onchange="WST.ITAreas({id:'areaId1',val:this.value,className:'j-areas'});">
            <option value="">-商家所在地-</option>
            {volist name="areaList" id="vo"}
            <option value="{$vo['areaId']}">{$vo['areaName']}</option>
            {/volist}
          </select>
          <input type="text" id="shopName"  placeholder='店铺名称' id="shopName" class='j-ipt'/>
          <select id="isInvestment" class='j-ipt'>
             <option value="-1">-是否招商推广-</option>
             <option value="1">是</option>
             <option value="0">否</option>
          </select>
          <select id="isApply" class='j-ipt'>
             <option value="-1">-申请状态-</option>
             <option value="1">已提交</option>
             <option value="0">填写中</option>
          </select>
          <button class="btn btn-primary" onclick='javascript:loadApplyGrid(0)'><i class='fa fa-search'></i>查询</button>
          <div style='clear:both'></div>
          </div>
          <div class='wst-grid'>
           <div id="mmg" class="mmg"></div>
           <div id="pg" style="text-align: right;"></div>
          </div>
      </div>
      <div class="layui-tab-item">
          <div class="wst-toolbar" style='padding-top:0px;'>
          <input type="text" id="linkkey"  placeholder='联系人/联系电话' id="linkkey" class='ja-ipt'/>
          <select id="applyStatus" class='ja-ipt'>
             <option value="-1">-申请状态-</option>
             <option value="0">待处理</option>
             <option value="1">已处理</option>
             <option value="-1">无效</option>
          </select>
          <button class="btn btn-primary" onclick='javascript:loadApplyGrid2(0)'><i class='fa fa-search'></i>查询</button>
          <div style='clear:both'></div>
          </div>
          <div class='wst-grid'>
           <div id="mmg2" class="mmg"></div>
           <div id="pg2" style="text-align: right;"></div>
          </div>
      </div>
    </div>
</div>
<div id='applyBox' style='display:none'>
    <form id='applyForm' method="post" autocomplete="off">
    <table class='wst-form wst-box-top'>
      <tr>
          <th width='150'>申请账号：</th>
          <td id='loginName'></td>
       </tr>
       <tr>
          <th width='150'>联系人：</th>
          <td id='linkman'></td>
       </tr>
       <tr>
          <th width='150'>联系电话：</th>
          <td id='linkPhone'></td>
       </tr>
       <tr>
          <th width='150'>营业范围：</th>
          <td id='applyIntention'></td>
       </tr>
       <tr>
          <th width='150'>处理结果<font color='red'>*</font>：</th>
          <td class="layui-form" lay-filter='applyStatusBox'>
             <input type='radio' name='applyStatus' id='applyStatus1' lay-filter='applyStatus' value='1' class='eipt' title='申请成功' data-rule="处理结果:checked">
             <input type='radio' name='applyStatus' id='applyStatus0' lay-filter='applyStatus' value='-1' class='eipt' title='申请失败'>
          </td>
       </tr>
       <tr class='applyStatusTr1' style='display:none'>
        <th width='150'>&nbsp;</th>
          <td style='color:red'>*审核通过后请手工在商家管理中开通商家类型</td>
       </tr>
       <tr class='applyStatusTr1' style='display:none'>
        <th width='150'>店铺名称<font color='red'>*</font></th>
          <td><input type='text' id='shopName' style='width:60%;' class='eipt' data-rule="店铺名称:required(#applyStatus1:checked)" maxlenght='20' placeholder="申请通过的店铺名称"></textarea></td>
       </tr>
       <tr class='applyStatusTr0' style='display:none'>
          <th width='150'>失败原因<font color='red'>*</font>：</th>
          <td>
             <textarea id='handleReamrk' style='width:90%;height:100px;' class='eipt' data-rule="失败原因:required(#applyStatus0:checked)" placeholder="请填写失败原因，申请客户可看" data-target='#msg_handleReamrk'></textarea>
            <div id='msg_handleReamrk'></div>
          </td>
       </tr>
    </table>
    </form>
</div>
<div id='applyBox2' style='display:none'>
    <table class='wst-form wst-box-top'>
      <tr>
          <th width='150'>申请账号：</th>
          <td id='vloginName'></td>
       </tr>
       <tr>
          <th width='150'>联系人：</th>
          <td id='vlinkman'></td>
       </tr>
       <tr>
          <th width='150'>联系电话：</th>
          <td id='vlinkPhone'></td>
       </tr>
       <tr>
          <th width='150'>营业范围：</th>
          <td id='vapplyIntention'></td>
       </tr>
       <tr>
          <th width='150'>处理结果：</th>
          <td id='vapplyStatus'></td>
       </tr>
       <tr class='vapplyStatusTr1' style='display:none'>
          <th width='150'>店铺名称：</th>
          <td id='vshopName'></td>
       </tr>
       <tr class='vapplyStatusTr0' style='display:none'>
          <th width='150'>失败原因：</th>
          <td id='vhandleReamrk'></td>
       </tr>
    </table>
</div>
<script>
$(function(){
  initApplyGrid({$p});
  var element = layui.element;
  element.on('tab(msgTab)', function(data){
     console.log(data.index);
     if(data.index==0)initApplyGrid({$p});
     if(data.index==1)initApplyGrid2({$p});
  });
})
</script>
{/block}